package enterprise.manage.entity;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2011-3-10
 * Time: 16:50:57
 * 访问日志实体类
 */
@Entity
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@Table(schema = "mpi", name = "Log_Request")
public class RequestLog {

    /**
     * 主键id
     */
    private Long id;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 访问时间
     */
    private Date requestTime;

    /**
     * 访问该地址的ip
     */
    private String ip;

    /**
     * 访问的地址 主要是记录进入控制器的地址
     */
    private String requestUrl;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Date getRequestTime() {
        return requestTime;
    }

    public void setRequestTime(Date requestTime) {
        this.requestTime = requestTime;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getRequestUrl() {
        return requestUrl;
    }

    public void setRequestUrl(String requestUrl) {
        this.requestUrl = requestUrl;
    }

    @Override
    public String toString() {
        return "RequestLog{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", requestTime=" + requestTime +
                ", ip='" + ip + '\'' +
                ", requestUrl='" + requestUrl + '\'' +
                '}';
    }
}
